package com.tepth.busfix.main.repair;

import com.tepth.busfix.base.BaseModel;
import com.tepth.busfix.base.BasePresenter;
import com.tepth.busfix.base.BaseView;
import com.tepth.busfix.bean.reponse.Process;
import com.tepth.busfix.bean.reponse.Repair;
import com.tepth.busfix.network.ApiModel;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by pc on 2017/3/15.
 */

public class RepairContract {

    interface View extends BaseView {
        String getAuthKey();

        String getRepairInfo();

        String getCancelPunchJson();

        long getBusId();

        long getTroubleTypeId();

        String getTroubleName();

        void showRepair(Repair repair);

        void postRepairInfoSucceed();

        void showCancelPunchSucceed();

        void showProcess(List<Process> list);
    }

    interface Model extends BaseModel {
        Observable<ApiModel<Repair>> getRepair(String authKey, long id);

        Observable<ApiModel<String>> postRepair(String authKey, String info);

        Observable<ApiModel<List<Process>>> getProcess(String authKey, long troubleTypeId,
                                                       String troubleName);

        Observable<ApiModel<String>> cancelPunchCard(String key, String json);
    }

    abstract static class Presenter extends BasePresenter<Model, View> {

        @Override
        public void onStart() {

        }

        public abstract void getRepair();

        public abstract void postRepair();

        public abstract void getProcess();

        public abstract void cancelPunchCard();
    }
}